EMT Practice Test

1. Question Content...


Question List

Question1: In the following example, which sharing context will myMethod execute when it is invoked?

Question2: A developer must troubleshoot to pinpoint the causes of performance issues when a custom page loads in their org. Which tool should the developer use to troubleshoot?

Question3: A develop completed modification to a customized feature that is comprised of two elements:
Apex trigger
Trigger handler Apex class
What are two factors that the developer must take into account to properly deploy the modification to the production environment?

Question4: How can a developer check the test coverage of active Process Builder and Flows deploying them in a Changing Set?

Question5: A developer needs to have records with specific field values in order to test a new Apex class.
What should the developer do to ensure the data is available to the test?

Question6: Which aspect of Apex programming is limited due to multitenancy?

Question7: which statement is true regarding execution order when triggers are associated to the same object and event?

Question8: What is the result of the following code?

Question9: A developer identifies the following triggers on the Expense __c object:
The triggers process before delete, before insert, and before update events respectively.
Which two techniques should the developer implement to ensure trigger best practices are followed?

Choose 2 answers

Question10: The following automations already exist on the Account object;
* A workflow rule that updates a field when a certain criteria is met
* A custom validation on a field
* A How that updates related contact records
A developer created a trigger on the Account object.
What should the developer consider while testing the trigger code?

Question11: What are three ways for 2 developer to execute tests in an org? Choose 3 answers

Question12: While developing an Apex class with custom search functionality that will be launched from a Lightning Web Component, how can the developer ensure only records accessible to the currently logged in user are displayed?

Question13: A company decides to implement a new process where every time an Opportunity is created, a follow up Task should be created and assigned to the Opportunity Owner.
What is the most efficient way for a developer to implement this?

Question14: Which exception type cannot be caught?

Question15: Which three code lines are required to create a Lightning component on a Visualforce page? Choose 3 answers

Question16: Cloud Kicks Fitness, an ISV Salesforce partner, is developing a managed package application. One of the application modules allows the user to calculate body fat using the Apex class, BodyFat, and its method, calculateBodyFat(). The product owner wants to ensure this method is accessible by the consumer of the application when developing customizations outside the ISV's package namespace.
Which approach should a developer take to ensure calculateBodyFat() is accessible outside the package namespace?

Question17: What are three ways for a developer to execute tests in an org? Choose 3.

Question18: A developer observes that an Apex test method fails in the Sandbox. To identify the issue, the developer copies the code inside the test method and executes it via the Execute Anonymous tool in the Developer Console. The code then executes with no exceptions or errors. Why did the test method fail in the sandbox and pass in the Developer Console?

Question19: When using SalesforceDX, what does a developer need to enable to create and manage scratch orgs?

Question20: niversal Containers (UC) processes orders in Salesforce in a custom object, Crder_c. They also allow sales reps to upload CSV files with of orders at a time.
A developer is tasked with integrating orders placed in Salesforce with UC's enterprise resource planning (ERP) system.
'After the status for an Craer__c is first set to "Placed', the order information must be sent to a REST endpoint in the ERP system that can process ne order at a time.
What should the developer implement to accomplish this?

Question21: A developer is tasked with building a custom Lightning web component to collect Contact information.
The form will be shared among many different types of users in the org. There are security requirements that only certain fields should be edited and viewed by certain groups of users.
What should the developer use in their Lightning Web Component to support the security requirements?

Question22: Which three resources in an Azure Component can contain JavaScript functions?

Question23: A developer must provide custom user interfaces when users edit a Contact in either Salesforce Classic or Lightning Experience.
What should the developer use to override the Contact's Edit button and provide this functionality?

Question24: Universal Containers needs to create a custom user interface component that allows users to enter information about their accounts.
The component should be able to validate the user input before saving the information to the database.
What is the best technology to create this component?

Question25: A developer has a single custom controller class that works with a Visualforce Wizard to support creating and editing multiple subjects. The wizard accepts data from user inputs across multiple Visualforce pages and from a parameter on the initial URL.
Which three statements are useful inside the unit test to effectively test the custom controller?
Choose 3 answers

Question26: What should a developer do to check the code coverage of a class after running all tests?

Question27: A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawable interfaces. public interface Sortable { void sort(); } public interface Drawable { void draw(); } Which is the correct implementation?

Question28: Universal Containers has an order system that uses an Order Number to identify an order for customers and service agents. Order records will be imported into Salesforce.
How should the Order Number field be defined in Salesforce?

Question29: A developer has identified a method in an Apex class that performs resource intensive actions in memory by iterating over the result set of a SOQL statement on the account. The method also performs a DML statement to save the changes to the datadase.
Which two techniques should the developer implement as a best practice to ensure transaction control and avoid exceeding governor limits?
Choose 2 answers

Question30: A developer created a trigger on the Account object. While testing the trigger, the developer sees the error message 'Maximum trigger depth exceeded', What could be the possible causes?

Question31: A developer created these three Rollup Summary fields in the custom object, Project__c:

The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project.
Which should the developer use to implement the business requirement in order to minimize maintenance overhead?

Question32: Which three statements are true regarding custom exceptions in Apex? (Choose three.)

Question33: A Lightning component has a wired property, searchResults, that stores a list of Opportunities. Which definition of the Apex method, to which the searchResults property is wired, should be used?

Question34: Which Lightning code segment should be written to declare dependencies on a Lightning component, c:accountList, that is used in a Visualforce page?

Question35: Universal Containers implemented a private sharing model for the Account object. A custom Account search tool was developed with Apex to help sales representatives find accounts that match multiple criteria they specify. Since its release, users of the tool report they can see Accounts they do not own. What should the developer use to enforce sharing permission for the currently logged-in user while using the custom search tool?

Question36: While working in a sandbox, an Apex test fails when run in the Test Runner. However, executing the Apex logic in the Execute Anonymous window succeeds with no exceptions or errors.
Why did the method fail in the sandbox test framework but succeed in the Developer Console?

Question37: Universal Containers has a support process that allows users to request support from its engineering team using a custom object, Engineering_Support__c.
Users should be able to associate multiple engineering_Support__c records to a single Opportunity record.
Additionally, aggregate Information about the Engineering_support__c records should be shown on the Opportunity record.
What should a developer Implement to support these requirements?

Question38: A developer wrote an Apex method to update a list of Contacts and wants to make it available for use by Lightning web components.
Which annotation should the developer add to the Apex method to achieve this?

Question39: A developer at AW Computing is tasked to create the supporting test class for a programmatic customization that leverages records stored within the custom object, Pricing Structure c. AW Computing has a complex pricing structure for each item on the store, spanning more than 500 records.
hich two approaches can the developer use to ensure Pricing _Structure__c records are available when the test class is executed?
Choose 2 answers

Question40: Which Apex class contains methods to return the amount of resources that have been used for a particular governor, such as the number of DML statements?

Question41: Consider the following code snippet:

Given the multi-tenant architecture of the Salesforce platform, what Is a best practice a developer should Implement and ensure successful execution of the method?

Question42: What are three capabilities of the <ltng : require> tag when loading JavaScript resources in Aura components?
Choose 3 answers

Question43: Which code displays the contents of a Visualforce page as a PDF?

Question44: Given the following code snippet, that is part of a custom controller for a Visualforce page:

In which two ways can the try/catch be enclosed to enforce object and field-level permissions and prevent the DML statement from being executed if the current logged-in user does not have the appropriate level of access? Choose 2 answers

Question45: What should a developer use to obtain the Id and Name of all the Leads. Accounts, and Contacts that hove the company name "Universal Containers"?

Question46: A custom object Trainer_c has a lookup field to another custom object Gym___c.
Which SOQL query will get the record for the Viridian City gym and it's trainers?

Question47: Which two are phases in the Aura application event propagation framework? Choose 2 answers

Question48: What are three considerations when using the @InvocableMethod annotation in Apex?
Choose 3 answers

Question49: A lead developer creates an Apex interface called "Laptop". Consider the following code snippet:

How can a developer use the Laptop Interface within the Silvertaptop class?

Question50: What can be easily developed using the Lightning Component framework?

Question51: A developer must write anApex method that will be called from a lightning component. The method may delete an Account stored in the accountRec variable.
Which method should a developer use to ensure only users that should be able to delete Accounts can successfully perform deletion?

Question52: When a user edits the postal Code on an Account, a custom Account text field named. Timezone' must be updated based on the values in a PostalCodeToTimezone_c custom ogject.
Which two automationtools can be used to implement this feature?
Choose 2 answers

Question53: A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit. public class without sharing OpportunityService( public static List<OpportunityLineItem> getOpportunityProducts(Set<Id> opportunityIds){ List<OpportunitylineItem> oppLineItems = new List<OpportunityLineItem>(); for(Id thisOppId : opportunityIds){ oppLineItems.addAll([Select Id FROM OpportunityLineItems WHERE OpportunityId = :thisOppId)]; } return oppLineItems; } } The above method might be called during a trigger execution via a Lightning component. Which technique should be implemented to avoid reaching the governor limit?

Question54: Which code statement includes an Apex method named updateaccounts in the Class AccountCont rolles for use in a Lightning web component?

Question55: Since Aura application events follow the traditional publish-subscribe model, which method is used to fire an event?

Question56: Universal Container wants Opportunities to no longer be editable when itreaches the Closed/Won stage. Which two strategies can a developer use to accomplish this?
Choose2 answer

Question57: What are two ways for a developer to execute tests in an org?

Question58: A developer has a Apex controller for a Visualforce page that takes an ID as a URL parameter. How should the developer prevent a cross site scripting vulnerability?

Question59: What are two use cases for executing Anonymous Apex code? Choose 2 answers

Question60: A developer created a child Lightning web component nested inside a parent Lightning web component, parent component needs to pass a string value to the child component.
In which two ways can this be accomplished?
Choose 2 answers

Question61: Developers at Universal Containers (UC) use version control to share their code changes, but they notice that when they deploy their code to different environments they often have failures. They decide to set up Continuous Integration (CI).
What should the UC development team use to automatically run tests as part of their CI process?

Question62: A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineItem trigger. Which method allows access to the price book?

Question63: A team of developers is working on a source-driven project that allows them to work independently, with many different org configurations. Which type of Salesforce orgs should they use for their development?

Question64: Which code in a Visualforce page and/or controller might present a security vulnerability?

Question65: Which two settings must be defined in order to update a record of a junction object? Choose 2 answers

Question66: Assuming that naze is 8 String obtained by an <apex:inpotText> tag on 8 Visualforce page, which two SOQL queries performed are safe from SOQL injection?
'Choose 2 answers

Question67: A developer Is Integrating with a legacy on-premise SQL database.
What should the developer use to ensure the data being Integrated is matched to the right records in Salesforce?

Question68: A developer wrote Apex code that calls out to an external system. How should a developer write the test to provide test coverage?

Question69: Universal Container uses Service Cloud with a custom field, stage_c, on the Case object.
Management wants to send a follow-up email reminder 6 hours after the stage_c field is set to '';Waiting on customer'' The .... Administrator wants to ensure the solution used is bulk safe.
Which two automation tools should a developer recommend to meet these business requirements?
Choose 2 answers

Question70: A developer needs to prevent the creation of Request__c records when certain coVraitions exist in the system. A RequeatLogic class exists that checks the conditions.
What is the correct implementation?

Question71: A developer has the following requirements:
* Calculate the total amount on an Order.
* Calculate the line amount for each Line Item based on quantity selected and price.
* Move Line Items to a different Order if a Line Item is not in stock.
Which relationship implementation supports these requirements on its own7

Question72: In terms of the MVC paradigm, what are two advantages of implementing the layer of a Salesforce application using Aura Component-based development over Visualforce? Choose 2 answers

Question73: A developer is writing tests for a class and needs to insert records to validate functionality.
Which annotation method should be used to create record for every method in the test class?

Question74: A developer is creating a Lightning web component to showa list of sales records.
The Sales Representative user should be able to see the commission field on each record. The Sales Assistant user should be able to see all fields on the record except the commission field.
How should this be enforced so that the component works for both users without showing any errors?

Question75: A developer Is asked to create a Visualforce page that lists the contacts owned by the current user. This component will be embedded In a Lightning page.
Without writing unnecessary code, which controller should be used for this purpose?

Question76: As part of new feature development, a developer is asked to build a responsive application capable of responding to touch events, that will be executed on stateful clients.
Which two technologies are built on a framework that fully supports the business requirement? Choose 2 answers

Question77: Consider the following code snippet for a Visualforce page that is launched using a Custom Button on the Account detail page layout.

When the Save button is pressed the developer must perform a complex validation that involves multiple objects and, upon success, redirect the user to another Visualforce page.
What can the developer use to meet this business requirement?

Question78: Management asked for opportunities to be automatically created for accounts with annual revenue greater than $1,000,000. A developer created the following trigger on the Account object to satisfy this requirement.

Users are able to update the account records via the UI and can see an opportunity created for high annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts using Data Loader, It fails with system. Exception errors.
Which two actions should the developer take to fix the code segment shown above?
Choose 2 answers

Question79: A development team wants to use a deployment script to automatically deploy to a sandbox during their development cycles.
Which two tools can they use to run a script that deploys to a sandbox?
Choose 2 answers

Question80: Which salesforce org has a complete duplicate copy of the production org including data and configuration?

Question81: A developer needs to create a baseline set of data (Account, Contacts, Products, Assets) for an entire suite allowing them to test independent requirements for various types of Salesforce Cases.
Which approach can efficiently generate the required data for each unit test?

Question82: Universal Containers wants to assess the advantages of declarative development versus programmatic customization for specific use cases in its Salesforce implementation.
What are two characteristics of declarative development over programmatic customization? Choose 2 answers

Question83: Universal Containers has developed custom Apex code and Lightning Components in a Sandbox environment. They need to deploy the code and associated configurations to the Production environment.
What is the recommended process for deploying the code and configurations to Production?

Question84: The Account object in an organization has a master detail relationship to a child object called Branch. The following automations exist:
* Rollup summary fields
* Custom validation rules
* Duplicate rules
A developer created a trigger on the Account object.
What two things should the developer consider while testing the trigger code?
Choose 2 answers

Question85: A developer is alerted to an issue with a custom Apex trigger that is causing records to be duplicated.
What is the most appropriate debugging approach to troubleshoot the issue?

Question86: A developer is asked to write helper methods that create test data for unit tests.

What should be changed in the Testvtils class so that its methods are only usable by unit test methods?

Question87: Which scenario is valid for execution by unit tests?

Question88: Which three data types can a SOQL query return?
Choose 3 answers

Question89: Universal Containers has a Visualforce page that displays a table of every Container__c being rented by a given Account. Recently this page is failing with a view state limit because some of the customers rent over 10,000 containers.
What should a developer change about the Visualforce page to help with the page load errors?

Question90: Where are two locations a developer can look to find information about the status of asynchronous or future methods? Choose 2 answers

Question91: Universal Hiring uses Salesforce to capture job applications. A salesforce administrator created two custom objects; Job__c acting as the maste object, Job _Application__c acting as the detail.
Within the Job ___c object, a custom multi-select picklist, preferred Locations __c, contains a list of approved states for the position. Each Job_Application__c record relates to a Contact within the system through a master-detail relationship.
Recruiters have requested the ability to view whether the Contact's Mailing State value matches a value selected on the Preferred_Locations__c field, within the Job_Application__c record. Recruiters would like this value to be kept in sync if changes occur to the Contact's Mailing State.
What is the recommended tool a developer should use to meet the business requirement?

Question92: An org tracks customer orders on an Order object and the items of an Order on the Line Item object. The Line Item object has a MasterDetail relationship to the order object. A developer has a requirement to calculate the order amount on an Order and the line amount on each Line item based on quantity and price.
What is the correct implementation?

Question93: How is a controller and extension specified for a custom object named "Notice" on a Visualforce page?

Question94: A developer wants to invoke on outbound message when a record meets a specific criteria.
Which three features satisfy this use case?
Choose 3 answer

Question95: Universal Container* decides to use purely declarative development to build out a new Salesforce application.
Which two options can be used to build out the business logic layer for this application?
Choose 2 answer

Question96: A developer created this Apex trigger that calls MyClass,myStartmethod:

The developer creates a test method that calls MyClase,myStartmethod directly, resulting in 81% overall code coverage.
What happens wtier the developer tries to deploy the ... and two classes to production, assuming no other code exists?

Question97: Universal Containers wants to ensure that all new leads created in the system have a valid email address. They have already created a validation rule to enforce this requirement, but want to add an additional layer of validation using automation.
What would be the best solution for this requirement?

Question98: Refer to the code snippet below:

When a Lightning web component is rendered, a list of apportunities that match certain criteria shopuld be retrievved from the database and displayed to the end user.

Choose 3 answer

Question99: A developer considers the following snippet of code:

Based on this code, what is the value of x?

Question100: Refer to the following Apex code:

What is the value of x when it is written to the debug log?

Question101: Which annotation should a developer use on an Apex method to make it available to be wired to a property in a Lightning web component?

Question102: Universal Containers has large number of custom applications that were built using a third-party javaScript framework and exposed using Visualforce pages. The Company wants to update these applications to apply styling that resembles the look and feel of Lightning Experience. What should the developer do to fulfill the business request in the quickest and most effective manner?

Question103: What are two benefits of using External IDs?
Choose 2 answers

Question104: When importing and exporting data into Salesforce, which two statements are true?
Choose 2 answers

Question105: A developer is migrating a Visualforce page into a Lightning web component.
The Visualforce page shows information about a single record. The developer decides to use Lightning Data Service to access record data.
Which security consideration should the developer be aware of?

Question106: Einstein Next Best Action Is configured at Universal Containers to display recommendations to internal users on the Account detail page.
If the recommendation is approved, a new opportunity record and task should be generated. If the recommendation is rejected, an Apex method must be executed to perform a callout to an external system.
Which three factors should a developer keep Hi mind when implementing the Apex method?
Choose 3 answers

Question107: What is the result of the following code snippet?